<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html><html lang="en">
	<head>
		<!--加载header文件-->
		<?php
		include_once 'public/views/header.php';
		?>
		<link rel="stylesheet" href="public/css/edit.css" />
		<script src="public/xr/xrDatatable.js"></script>	
        <script src="public/home/js/function.js"></script>
		<script src="public/js/list.js"></script>
	</head>
	<style >
		th,td{
			text-align: center!important;
		}
		.index-b{
	   		border-radius:10px; height:16px;  padding:0px 5px 0px 5px; line-height:16px; display:inline-block;  color:white; background-color:#44C678; font-size:10px;
	   	}
	   	body{
		    background-color: white!important;
		}
		.xrTable tbody tr td a {
			margin-left: 0;
		}
	</style>
	<body>		
		<div class="container">
			<div class="row">
				<input type="hidden" id="modal_title" value="<?=$title ?>" />
				<input type="hidden" id="modal_height" value="450" />
				<input type="hidden" name="select" id="select" value="<?=$params['select'] ?>"/>
				<input type="hidden" name="type" id="type" value="<?=$params['type'] ?>"/>
				<input type="hidden" name="course_units"id="course_units" value="<?=$params['course_units'] ?>"/>
				<input type="hidden" name="start_time" id="start_time" value="<?=$params['start_time'] ?>"/>
				<input type="hidden" name="end_time" id="end_time" value="<?=$params['end_time'] ?>"/>
				<input type="hidden" name="source" id="source" value="<?=$params['source'] ?>"/>
				<form id="editForm">
				<table class='edit_table'>
					<tr>
						<th style="height:30px;">序号</th>
						<th style="height:30px;">工号</th>
						<th>姓名</th>
						<th>总分</th>
					</tr>
					
				<?php foreach ($list as $k => $v):?>					
					<tr>
						<td><b class="index-b"><?php echo $k+1 ?></b></td>
						<td><?php echo $v['teacher_code'] ?></td>
						<td><?php echo $v['teacher_name'] ?></td>
						<td><?php echo $v['score'] ?></td>
					</tr>
				<?php endforeach ?>

			</form>
	
				
			</div>
		</div>
	</body>	
<script>

		$(function() {
			addDialogButton("导出",exports);
		});

		var exports = function() {
			var data = getFormJson();
			data.select = $("#select").val();
			data.type = $("#type").val();
			data.course_units = $("#course_units").val();
			data.start_time = $("#start_time").val();
			data.end_time = $("#end_time").val();

			var	source = $("#source").val(); 
			if(source == 'Attended'){
				var url = "Admin/StatisticsAttended/getTeacherList/1/1/1/1/1/1/true";
			}else if(source == 'AttendDept'){
				var url = "Admin/StatisticsAttendDept/getTeacherList/1/1/1/1/1/1/true";
			}
			//	console.log(data);

			var msg = "请确认是否导出?";
		    swal({
		        title: "请确认",
		        text: msg,
		        type: "warning",
		        showCancelButton: true,
		        closeOnConfirm: true,
		        confirmButtonText: "确定",
		        cancelButtonText: '取消',
		        confirmButtonColor: "#ec6c62"
		    }, function(isConfirm) {
		        if(isConfirm) {
		            $.ajax({
		                type: "post",
		                url: url,
		                data:data,
		                async: true,
		                dataType:'json',
		                success: function(data) {
		                    if(data.status) {
		                        location.href=getRootPath()+'/'+data.v;
		                    } else {
		                        window.parent.topMessagePrompt('error',ret.msg);
		                    }
		                }
		            });
		        }
		    });
		}

	</script>
</html>
